<!-- <script src="./public.js"></script> -->
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>
    const $ = {}
    // API 域名
    $.baseUrl = 'http://quanyi.hxjx360.com/api';
    // API 请求头
    $.headers = {
        'test': '666',
        'Accept': 'application/json, text/plain, */*',
        'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
        'Host': 'quanyi.hxjx360.com',
        'Origin': 'http://quanyi.hxjx360.com',
        'Referer': `http://quanyi.hxjx360.com/invest`,
        'Content-Type': 'application/json;charset=utf-8',
        'User-Agent': 'JD4iPhone/167490 (iPhone; iOS 14.2; Scale/3.00)',
    }
    function login($, username, password) {
        return new Promise(resolve => {
            axios({
                url: $.baseUrl + `/login2?username=${username}&password=password_CODE_PW_OPENID_${password}_CODE_PW_OPENID_undefined`,
                method: "POST",
                headers: { ...$.headers },
            }).then(response => {
                console.log('/a', response.data)
                // const cookie = resp.headers['set-cookie']
                // if (cookie) {
                //     console.log(username + ' 登录成功 ' + cookie);
                // }
                //
                resolve(response.data);
            }, error => {
                console.log('错误', error.message)
            })
        })
    }
    console.log(11, login($, '1', '2'));
</script>
123